﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterSGA.Master" AutoEventWireup="true" CodeBehind="Charge.aspx.cs" Inherits="SGA.Charges.Charge" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <h2>Gestão de cobranças</h2>

    <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </ajaxToolkit:ToolkitScriptManager>

    <div id="leftcolumnwrap">
        <div id="leftcolumn">
            <%--<div class="InLine">
                        <asp:Label ID="NameBankLbl" runat="server" Text="Nome" CssClass="LeftAlignLabel"></asp:Label>
                        <br />
                        <asp:TextBox ID="NameBankTbox" runat="server" Columns="80"></asp:TextBox>
                    </div>
                    <div class="InLine">
                        <asp:Label ID="IBANLbl" runat="server" Text="IBAN" CssClass="LeftAlignLabel"></asp:Label>
                        <br />
                        <asp:TextBox ID="IBANTbox" runat="server" Columns="50"></asp:TextBox>
                    </div>
                    <div>
                        <asp:CheckBox ID="IsActiveBankChkBox" runat="server" Text="Mostrar este banco nas opções de cobrança" Checked="True" />
                    </div>
                    <div>
                        <asp:CheckBox ID="IsDefaultBankChkBox" runat="server" Text="Definir este banco como banco padrão de cobrança" Checked="True" />
                    </div>--%>
            <asp:Button ID="DisableEnterBtn" runat="server" Text="" OnClientClick="return false;" Visible="False" />

            <p>
                <asp:Button ID="NewCollectionBtn" runat="server" Text="Criar nova emissão" CssClass="buttonContext" OnClick="NewCollectionBtn_Click" />
                <asp:Button ID="SaveButton" runat="server" Text="Gravar" CssClass="buttonContext" />

            </p>
            <p>
                <asp:Button ID="CreateSepaFileBtn" runat="server" Text="Criar ficheiro SEPA" CssClass="buttonContext" OnClick="CreateSepaFileBtn_Click" />
            </p>
            <p>
                <asp:Button ID="ReceiptsBtn" runat="server" Text="Reimpressão de recibos" CssClass="buttonContext" />
            </p>
        </div>
    </div>

    <%--Data Sources--%>
    <asp:EntityDataSource ID="EDSCollectionBanks" runat="server" ConnectionString="name=MailingEntities" DefaultContainerName="MailingEntities" EnableFlattening="False" EntitySetName="CollectionBanks" EnableDelete="True" EnableInsert="True" EnableUpdate="True" OrderBy="it.Designation">
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="EDSCollectonRanges" runat="server" ConnectionString="name=MailingEntities" DefaultContainerName="MailingEntities" EnableFlattening="False" EntitySetName="CollectionRanges" EnableDelete="True" EnableInsert="True" EnableUpdate="True" OrderBy="it.CollectionDay">
    </asp:EntityDataSource>

    <div class="InLine">
        <div id="Notifications">
            <asp:Label ID="NotificationLabel" runat="server" BackColor="Red" BorderColor="Black" Font-Bold="True" ForeColor="White" Width="1000px"></asp:Label>
        </div>

        <ajaxToolkit:TabContainer ID="ChargeTabContainer" runat="server" ActiveTabIndex="0" Height="494px" Width="1080px" ScrollBars="Auto" AutoPostBack="True" OnActiveTabChanged="ChargeTabContainer_ActiveTabChanged">
            <ajaxToolkit:TabPanel ID="ChargesTabPanel" runat="server" HeaderText="Cobrança">
                <ContentTemplate>

                    <div id="CollectionTypeDiv">
                        <fieldset>
                            <legend style="color: blue; font-weight: bold;">Tipo de cobrança</legend>

                            <div id="LeftCollectionTypeDiv" class="InLine">
                                <asp:RadioButton ID="FirstRbtn" runat="server" Text="Primeira cobrança/Alterações à cobrança" GroupName="ChargeType" />
                                <br />
                                <asp:RadioButton ID="RcurRbtn" runat="server" Text="Cobranças seguintes" GroupName="ChargeType" />
                            </div>
                        </fieldset>
                    </div>

                    <div id="LastEmissionDiv">
                        <fieldset>
                            <legend style="color: blue; font-weight: bold;">Última emissão</legend>

                            <div class="InLine">
                                <asp:Label ID="LastReceiptLbl" runat="server" Text="Último recibo" CssClass="LeftAlignLabel"></asp:Label>
                                <br />
                                <asp:TextBox ID="LastReceiptTbox" runat="server" Columns="15" Enabled="False"></asp:TextBox>
                            </div>
                            <div class="InLine">
                                <asp:Label ID="LastSeriesLbl" runat="server" Text="Série" CssClass="LeftAlignLabel"></asp:Label>
                                <br />
                                <asp:TextBox ID="LastSeriesTbox" runat="server" Columns="15" Enabled="False"></asp:TextBox>
                            </div>
                            <div class="InLine">
                                <asp:Label ID="LastTypeLbl" runat="server" Text="Tipo" CssClass="LeftAlignLabel"></asp:Label>
                                <br />
                                <asp:TextBox ID="LastTypeTbox" runat="server" Columns="5" Enabled="False"></asp:TextBox>
                            </div>
                            <div class="InLine">
                                <asp:Label ID="DateLbl" runat="server" Text="Data emissão" CssClass="LeftAlignLabel"></asp:Label>
                                <br />
                                <asp:TextBox ID="LastDateTbox" runat="server" Columns="15" Enabled="False"></asp:TextBox>
                            </div>
                            <div class="InLine">
                                <asp:Label ID="LastQuantReceiptsLbl" runat="server" Text="Nº de recibos" CssClass="LeftAlignLabel"></asp:Label>
                                <br />
                                <asp:TextBox ID="LastQuantReceiptsTbox" runat="server" Columns="15" Enabled="False"></asp:TextBox>
                            </div>
                            <div class="InLine">
                                <asp:Label ID="LastValueLbl" runat="server" Text="Valor" CssClass="LeftAlignLabel"></asp:Label>
                                <br />
                                <asp:TextBox ID="LastValueTbox" runat="server" Columns="15" Enabled="False"></asp:TextBox>
                            </div>
                            <div class="InLine">
                                <asp:Label ID="LastEmissionLbl" runat="server" Text="Nº Emissão" CssClass="LeftAlignLabel"></asp:Label>
                                <br />
                                <asp:TextBox ID="LastEmissionTbox" runat="server" Columns="15" Enabled="False"></asp:TextBox>
                            </div>
                            <div class="InLine">
                                <asp:Label ID="LastRangeCollectionLbl" runat="server" Text="Dia cob." CssClass="LeftAlignLabel"></asp:Label>
                                <br />
                                <asp:TextBox ID="LastRangeCollectionTbox" runat="server" Columns="10" Enabled="False"></asp:TextBox>
                            </div>

                        </fieldset>
                    </div>

                    <div id="NewEmissionDiv">
                        <fieldset>
                            <legend style="color: blue; font-weight: bold;">Nova emissão</legend>
                            <div>
                                <p>Se o último dia coincidir com o fim-de-semana ou feriado, será cobrado no dia útil seguinte.</p>
                            </div>
                            <div class="InLine">
                                <asp:Label ID="BankLbl" runat="server" Text="Banco de cobrança" CssClass="LeftAlignLabel"></asp:Label>
                                <br />
                                <asp:DropDownList ID="BankDdl" DataTextField="Designation" DataValueField="Id" runat="server" Width="250px">
                                </asp:DropDownList>
                            </div>
                            <div class="InLine">
                                <asp:Label ID="YearLbl" runat="server" Text="Ano" CssClass="LeftAlignLabel"></asp:Label>
                                <br />
                                <asp:DropDownList ID="YearDdl" DataTextField="Designation" DataValueField="Id" runat="server" Width="100px">
                                </asp:DropDownList>
                            </div>
                            <div class="InLine">
                                <asp:Label ID="MonthLbl" runat="server" Text="Mês" CssClass="LeftAlignLabel"></asp:Label>
                                <br />
                                <asp:DropDownList ID="MonthDdl" DataValueField="Id" runat="server" Width="100px">
                                    <asp:ListItem Value="1">Janeiro</asp:ListItem>
                                    <asp:ListItem Value="2">Fevereiro</asp:ListItem>
                                    <asp:ListItem Value="3">Março</asp:ListItem>
                                    <asp:ListItem Value="4">Abril</asp:ListItem>
                                    <asp:ListItem Value="5">Maio</asp:ListItem>
                                    <asp:ListItem Value="6">Junho</asp:ListItem>
                                    <asp:ListItem Value="7">Julho</asp:ListItem>
                                    <asp:ListItem Value="8">Agosto</asp:ListItem>
                                    <asp:ListItem Value="9">Setembro</asp:ListItem>
                                    <asp:ListItem Value="10">Outubro</asp:ListItem>
                                    <asp:ListItem Value="11">Novembro</asp:ListItem>
                                    <asp:ListItem Value="12">Dezembro</asp:ListItem>
                                </asp:DropDownList>
                            </div>
                            <div class="InLine">
                                <asp:Label ID="RangeCollectionLbl" runat="server" Text="Cobrança no dia:" CssClass="LeftAlignLabel"></asp:Label>
                                <br />
                                <asp:DropDownList ID="RangeCollectionDdl" DataTextField="CollectionDay" DataValueField="Id" runat="server" Width="100px" AppendDataBoundItems="True">
                                    <asp:ListItem></asp:ListItem>
                                </asp:DropDownList>
                            </div>

                            <div>
                                <asp:CheckBox ID="CreateFileChkBox" runat="server" Text="Criar o arquivo, automaticamente, logo após a criação da nova emissão" />
                            </div>

                        </fieldset>
                    </div>

                    <div id="CreateFilesDiv">
                        <fieldset>
                            <legend style="color: blue; font-weight: bold;">Criação de ficheiros</legend>

                            <div class="InLine">
                                <asp:Label ID="DataCollectionLbl" runat="server" Text="Data" CssClass="LeftAlignLabel"></asp:Label>
                                <br />
                                <asp:TextBox ID="DataCollectionTbox" runat="server" Columns="15"></asp:TextBox>
                                <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="DataCollectionTbox" DaysModeTitleFormat="dd-MM-yyyy" Enabled="True" Format="dd-MM-yyyy" TodaysDateFormat="dd-MM-yyyy" CssClass="MyCalendar"></ajaxToolkit:CalendarExtender>
                            </div>
                            <div class="InLine">
                                <asp:Label ID="EmissionLbl" runat="server" Text="Emissão" CssClass="LeftAlignLabel"></asp:Label>
                                <br />
                                <asp:DropDownList ID="EmissionDdl" DataTextField="Designation" DataValueField="Id" runat="server" Width="100px">
                                </asp:DropDownList>
                            </div>
                            <div class="InLine">
                                <asp:Label ID="TypeLbl" runat="server" Text="Tipo" CssClass="LeftAlignLabel"></asp:Label>
                                <br />
                                <asp:TextBox ID="TypeTbox" runat="server" Columns="5" Enabled="False"></asp:TextBox>
                            </div>
                            <div class="InLine">
                                <asp:Label ID="DateEmsLbl" runat="server" Text="Data emissão" CssClass="LeftAlignLabel"></asp:Label>
                                <br />
                                <asp:TextBox ID="DateEmsTbox" runat="server" Columns="15" Enabled="False"></asp:TextBox>
                            </div>
                            <div class="InLine">
                                <asp:Label ID="Label6" runat="server" Text="Nº de recibos" CssClass="LeftAlignLabel"></asp:Label>
                                <br />
                                <asp:TextBox ID="TextBox5" runat="server" Columns="15" Enabled="False"></asp:TextBox>
                            </div>
                            <div class="InLine">
                                <asp:Label ID="Label7" runat="server" Text="Valor" CssClass="LeftAlignLabel"></asp:Label>
                                <br />
                                <asp:TextBox ID="TextBox6" runat="server" Columns="15" Enabled="False"></asp:TextBox>
                            </div>
                            <div class="InLine">
                                <asp:Label ID="Label9" runat="server" Text="Dia cob." CssClass="LeftAlignLabel"></asp:Label>
                                <br />
                                <asp:TextBox ID="TextBox8" runat="server" Columns="10" Enabled="False"></asp:TextBox>
                            </div>

                        </fieldset>
                    </div>
                </ContentTemplate>
            </ajaxToolkit:TabPanel>

            <ajaxToolkit:TabPanel ID="TabPanel2" runat="server" HeaderText="Bancos de cobrança">
                <ContentTemplate>
                    <p>
                        Gestão dos bancos de cobrança
                    </p>

                    <div>
                        <asp:ListView ID="CollectionBanksLvw" runat="server" DataKeyNames="Id" InsertItemPosition="FirstItem">
                            <AlternatingItemTemplate>
                                <tr style="background-color: #FFF8DC;">
                                    <%--<td>
                                        <asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
                                    </td>--%>
                                    <td>
                                        <asp:Label ID="DesignationLabel" runat="server" Text='<%# Eval("Designation") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="IBANLabel" runat="server" Text='<%# Eval("IBAN") %>' />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsActiveCheckBox" runat="server" Checked='<%# Eval("IsActive") %>' Enabled="false" />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsDefaultCheckBox" runat="server" Checked='<%# Eval("IsDefault") %>' Enabled="false" />
                                    </td>
                                    <td>
                                        <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                                        <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" />
                                    </td>
                                </tr>
                            </AlternatingItemTemplate>
                            <EditItemTemplate>
                                <tr style="background-color: #008A8C; color: #FFFFFF;">
                                    <%--<td>
                                        <asp:Label ID="IdLabel1" runat="server" Text='<%# Eval("Id") %>' />
                                    </td>--%>
                                    <td>
                                        <asp:TextBox ID="DesignationTextBox" runat="server" Text='<%# Bind("Designation") %>' Width="350" />
                                    </td>
                                    <td>
                                        <asp:TextBox ID="IBANTextBox" runat="server" Text='<%# Bind("IBAN") %>' Width="250" />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsActiveCheckBox" runat="server" Checked='<%# Bind("IsActive") %>' />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsDefaultCheckBox" runat="server" Checked='<%# Bind("IsDefault") %>' />
                                    </td>
                                    <td>
                                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                                    </td>
                                </tr>
                            </EditItemTemplate>
                            <EmptyDataTemplate>
                                <table id="Table1" runat="server" style="background-color: #FFFFFF; border-collapse: collapse; border-color: #999999; border-style: none; border-width: 1px;">
                                    <tr>
                                        <td>No data was returned.</td>
                                    </tr>
                                </table>
                            </EmptyDataTemplate>
                            <InsertItemTemplate>
                                <tr style="">
                                    <%--<td>
                                        <asp:TextBox ID="IdTextBox" runat="server" Text='<%# Bind("Id") %>' />
                                    </td>--%>
                                    <td>
                                        <asp:TextBox ID="DesignationTextBox" runat="server" Text='<%# Bind("Designation") %>' Width="350" />
                                    </td>
                                    <td>
                                        <asp:TextBox ID="IBANTextBox" runat="server" Text='<%# Bind("IBAN") %>' Width="250" />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsActiveCheckBox" runat="server" Checked='<%# Bind("IsActive") %>' />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsDefaultCheckBox" runat="server" Checked='<%# Bind("IsDefault") %>' />
                                    </td>
                                    <td>
                                        <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
                                        <%--<asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />--%>
                                    </td>
                                </tr>
                            </InsertItemTemplate>
                            <ItemTemplate>
                                <tr style="background-color: #DCDCDC; color: #000000;">
                                    <%--<td>
                                        <asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
                                    </td>--%>
                                    <td>
                                        <asp:Label ID="DesignationLabel" runat="server" Text='<%# Eval("Designation") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="IBANLabel" runat="server" Text='<%# Eval("IBAN") %>' />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsActiveCheckBox" runat="server" Checked='<%# Eval("IsActive") %>' Enabled="false" />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsDefaultCheckBox" runat="server" Checked='<%# Eval("IsDefault") %>' Enabled="false" />
                                    </td>
                                    <td>
                                        <asp:Button ID="EditButton" runat="server" CommandName="Edit" CommandArgument='<%#Eval("Id") %>' Text="Edit" />
                                        <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" CommandArgument='<%#Eval("Id") %>' Text="Delete" OnClientClick="javascript:return confirm('Are you sure to delete user?')" />
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <LayoutTemplate>
                                <table id="Table2" runat="server">
                                    <tr id="Tr1" runat="server">
                                        <td id="Td1" runat="server">
                                            <table id="itemPlaceholderContainer" runat="server" border="1" style="background-color: #FFFFFF; border-collapse: collapse; border-color: #999999; border-style: none; border-width: 1px; font-family: Verdana, Arial, Helvetica, sans-serif;">
                                                <tr id="Tr2" runat="server" style="background-color: #DCDCDC; color: #000000;">
                                                    <%--<th id="Th1" runat="server"></th>--%>
                                                    <%--<th id="Th2" runat="server">Id</th>--%>
                                                    <th id="Th3" runat="server">Nome do banco</th>
                                                    <th id="Th4" runat="server">IBAN</th>
                                                    <th id="Th5" runat="server">Activo</th>
                                                    <th id="Th6" runat="server">Padrão</th>
                                                    <th id="Th7" runat="server">Acção</th>
                                                </tr>
                                                <tr id="itemPlaceholder" runat="server">
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr id="Tr3" runat="server">
                                        <td id="Td2" runat="server" style="text-align: center; background-color: #CCCCCC; font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000;">
                                            <asp:DataPager ID="DataPager1" runat="server" PageSize="7">
                                                <Fields>
                                                    <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                                    <asp:NumericPagerField />
                                                    <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                                </Fields>
                                            </asp:DataPager>
                                        </td>
                                    </tr>
                                </table>
                            </LayoutTemplate>
                            <SelectedItemTemplate>
                                <tr style="background-color: #008A8C; font-weight: bold; color: #FFFFFF;">
                                    <%--<td>
                                        <asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
                                    </td>--%>
                                    <td>
                                        <asp:Label ID="DesignationLabel" runat="server" Text='<%# Eval("Designation") %>' Width="350" />
                                    </td>
                                    <td>
                                        <asp:Label ID="IBANLabel" runat="server" Text='<%# Eval("IBAN") %>' Width="250" />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsActiveCheckBox" runat="server" Checked='<%# Eval("IsActive") %>' Enabled="false" />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsDefaultCheckBox" runat="server" Checked='<%# Eval("IsDefault") %>' Enabled="false" />
                                    </td>
                                    <td>
                                        <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                                        <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" />
                                    </td>
                                </tr>
                            </SelectedItemTemplate>
                        </asp:ListView>
                        <p>
                            Activo: Mostra o banco nas opções de cobrança
                            <br />
                            Padrão: Define o banco que vai aparecer seleccionado nas opções de cobrança
                        </p>
                    </div>
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
            <ajaxToolkit:TabPanel ID="TabPanel3" runat="server" HeaderText="Faixas de cobrança">
                <ContentTemplate>
                    <p>
                        Gestão das datas de cobrança
                    </p>
                    <div id="RangeCollectionDiv">
                        <asp:ListView ID="CollectionRangeLvw" runat="server" DataKeyNames="Id" InsertItemPosition="FirstItem">
                            <AlternatingItemTemplate>
                                <tr style="background-color: #FFF8DC;">
                                    <%--<td>
                                        <asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
                                    </td>--%>
                                    <td>
                                        <asp:Label ID="CollectionDayLabel" runat="server" Text='<%# Eval("CollectionDay") %>' />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsActiveCheckBox" runat="server" Checked='<%# Eval("IsActive") %>' Enabled="false" />
                                    </td>
                                    <td>
                                        <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                                        <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" />
                                    </td>
                                </tr>
                            </AlternatingItemTemplate>
                            <EditItemTemplate>
                                <tr style="background-color: #008A8C; color: #FFFFFF;">
                                    <%--<td>
                                        <asp:Label ID="IdLabel1" runat="server" Text='<%# Eval("Id") %>' />
                                    </td>--%>
                                    <td>
                                        <asp:TextBox ID="CollectionDayTextBox" runat="server" Text='<%# Bind("CollectionDay") %>' Width="50" />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsActiveCheckBox" runat="server" Checked='<%# Bind("IsActive") %>' />
                                    </td>
                                    <td>
                                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                                    </td>
                                </tr>
                            </EditItemTemplate>
                            <EmptyDataTemplate>
                                <table id="Table3" runat="server" style="background-color: #FFFFFF; border-collapse: collapse; border-color: #999999; border-style: none; border-width: 1px;">
                                    <tr>
                                        <td>No data was returned.</td>
                                    </tr>
                                </table>
                            </EmptyDataTemplate>
                            <InsertItemTemplate>
                                <tr style="">
                                    <%-- <td>
                                        <asp:TextBox ID="IdTextBox" runat="server" Text='<%# Bind("Id") %>' />
                                    </td>--%>
                                    <td>
                                        <asp:TextBox ID="CollectionDayTextBox" runat="server" Text='<%# Bind("CollectionDay") %>' Width="50" />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsActiveCheckBox" runat="server" Checked='<%# Bind("IsActive") %>' />
                                    </td>
                                    <td>
                                        <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
                                        <%-- <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />--%>
                                    </td>
                                </tr>
                            </InsertItemTemplate>
                            <ItemTemplate>
                                <tr style="background-color: #DCDCDC; color: #000000;">
                                    <%--<td>
                                        <asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
                                    </td>--%>
                                    <td>
                                        <asp:Label ID="CollectionDayLabel" runat="server" Text='<%# Eval("CollectionDay") %>' />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsActiveCheckBox" runat="server" Checked='<%# Eval("IsActive") %>' Enabled="false" />
                                    </td>
                                    <td>
                                        <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                                        <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" />
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <LayoutTemplate>
                                <table id="Table4" runat="server">
                                    <tr id="Tr4" runat="server">
                                        <td id="Td3" runat="server">
                                            <table id="itemPlaceholderContainer" runat="server" border="1" style="background-color: #FFFFFF; border-collapse: collapse; border-color: #999999; border-style: none; border-width: 1px; font-family: Verdana, Arial, Helvetica, sans-serif;">
                                                <tr id="Tr5" runat="server" style="background-color: #DCDCDC; color: #000000;">
                                                    <%--<th runat="server"></th>
                                                    <th runat="server">Id</th>--%>
                                                    <th id="Th1" runat="server">Dia</th>
                                                    <th id="Th2" runat="server">Activo</th>
                                                    <th id="Th8" runat="server">Acção</th>
                                                </tr>
                                                <tr id="itemPlaceholder" runat="server">
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr id="Tr6" runat="server">
                                        <td id="Td4" runat="server" style="text-align: center; background-color: #CCCCCC; font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000;">
                                            <asp:DataPager ID="DataPager1" runat="server" PageSize="7">
                                                <Fields>
                                                    <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                                    <asp:NumericPagerField />
                                                    <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                                </Fields>
                                            </asp:DataPager>
                                        </td>
                                    </tr>
                                </table>
                            </LayoutTemplate>
                            <SelectedItemTemplate>
                                <tr style="background-color: #008A8C; font-weight: bold; color: #FFFFFF;">
                                    <%--<td>
                                        <asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
                                    </td>--%>
                                    <td>
                                        <asp:Label ID="CollectionDayLabel" runat="server" Text='<%# Eval("CollectionDay") %>' />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsActiveCheckBox" runat="server" Checked='<%# Eval("IsActive") %>' Enabled="false" />
                                    </td>
                                    <td>
                                        <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                                        <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" />
                                    </td>
                                </tr>
                            </SelectedItemTemplate>

                        </asp:ListView>
                        <p>
                            Activo: Mostra a data nas faixas de cobrança
                        </p>
                    </div>
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
        </ajaxToolkit:TabContainer>

    </div>

</asp:Content>
